﻿<Components:ComponentEditorBase x:Class="Components.EmailEditor"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
           xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
           xmlns:Components="clr-namespace:Components" 
           xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
           Width="Auto" Height="Auto" 
           Title="EmailEditor">
    <Grid x:Name="LayoutRoot" Margin="2">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <StackPanel Orientation="Vertical" Grid.Row="0">
            <CheckBox x:Name="ckUseOutlook" Content="Use Outlook"
                      IsChecked="false" Click="ckUseOutlook_Click"/>
            
            <Controls:Expander Header="Email server" IsExpanded="True">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="4"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                    </Grid.RowDefinitions>
                    
                    <TextBlock Grid.Column="1" Grid.Row="1"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="SMTP server:"/>
                    <TextBox Grid.Column="3" Grid.Row="1"
                             x:Name="txtSmtp" Text="mail.discoverylogic.com"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="3"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="From:"/>
                    <TextBox Grid.Column="3" Grid.Row="3"
                             x:Name="txtFrom" Text="workflow@discoverylogic.com"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="5"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="To:"/>
                    <TextBox Grid.Column="3" Grid.Row="5"
                             x:Name="txtTo" Text="xiaodongl@discoverylogic.com"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="7"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Subject:"/>
                    <TextBox Grid.Column="3" Grid.Row="7"
                             x:Name="txtSubj" Text=""/>
                </Grid>
            </Controls:Expander>
            
            <Controls:Expander Header="Advanced settings">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="4"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="4"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="3"/>
                    </Grid.RowDefinitions>

                    <CheckBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="1"
                              x:Name="ckAuthentication" IsChecked="false" 
                              Content="Require authentication" 
                              Click="ckAuthentication_Click"/>
                    
                    <TextBlock Grid.Column="1" Grid.Row="3"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="User name:"/>
                    <TextBox Grid.Column="3" Grid.Row="3"
                             x:Name="txtUserName" IsEnabled="False"/>

                    <TextBlock Grid.Column="1" Grid.Row="5"
                               TextAlignment="Right" HorizontalAlignment="Right"
                               Text="Password:"/>
                    <PasswordBox Grid.Column="3" Grid.Row="5"
                             x:Name="txtPassword" IsEnabled="False"/>
                    
                    <CheckBox Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="7"
                              x:Name="ckSSL" Content="Enable SSL"/>
                </Grid>
            </Controls:Expander>
            
            <controls:TabControl>
                <controls:TabItem Header="Attachments">
                    <StackPanel Orientation="Vertical">
                        <Button x:Name="btnBrowse" Content="Browse.."/>
                        <ListBox x:Name="lbAttachedFiles" MinHeight="120"/>
                    </StackPanel>
                </controls:TabItem>
                <controls:TabItem Header="Body">
                    <TextBox x:Name="txtBody" AcceptsReturn="True" TextWrapping="Wrap"
                             MinHeight="200"/>
                </controls:TabItem>
            </controls:TabControl>
        </StackPanel>
        
        <Button x:Name="CancelButton" Content="Cancel" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="OK" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
    </Grid>
</Components:ComponentEditorBase>